﻿#ifndef VIEW_H
#define VIEW_H

#include <QObject>
#include<QGraphicsView>
#include<QGraphicsScene>
#include<QList>
#include<QTimer>
#include<QMouseEvent>
#include"gun.h"
#include"fish.h"
#include"bullet.h"

class view:public QGraphicsView
{
    Q_OBJECT
public:
    view(QWidget*parent=NULL);
    ~view();
    void initControl();
    static view* getInstance();
protected:
    void mouseMoveEvent(QMouseEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;
private:
    gun *g;
    QTimer*timer;
    QList<fish*>fishList;
    QGraphicsScene *scene;
    static view *v;
};

#endif // VIEW_H
